<?php
require "lianjie.php";
require "database.php";
$mac = $_GET['mac'];
$id = $_GET['id'];
$con = lianjieshujuku($servername, $name, $passwd);
if (!mysqli_select_db($con, 'flower')) {
    die("选择数据库失败");
}
$req = mysqli_query($con, "SELECT * FROM `fname` WHERE `mac`='$mac'");
$array = mysqli_fetch_array($req);

$atname = $array['atname'];
$atname_explode = explode("|", $atname);

$peizhi_array = Array();
$peizhi_array['mode'] = $array['mode'];
$peizhi_array['kongshi'] = $array['kongshi'];
$peizhi_array['kongwen'] = $array['kongwen'];
$peizhi_array['jt'] = $array['jt'];
$peizhi_array['pt'] = $array['pt'];
$peizhi_array['at'] = $array['at'];
$peizhi_array['atname'] = $atname_explode[$id-1];
echo json_encode($peizhi_array);